extends Control

@onready var empty_hearts: TextureRect = $EmptyHearts
@onready var full_hearts: TextureRect = $FullHearts

@export var player_stat:Stat

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	player_stat.health_change.connect(set_full_heart)
	set_empty_heart(player_stat.max_health)
	set_full_heart(player_stat.health)
	


func set_full_heart(value:int) ->void:
	full_hearts.size.x = value * 15
	
func set_empty_heart(value:int) -> void:
	empty_hearts.size.x = value * 15
